function navActive() {
	var navEls = document.getElementById("nav").getElementsByTagName("li");
	console.log("gg");
	for (var i=0; i<navEls.length; i++) {
		navEls[i].onmouseover=function() {
			this.className += (this.className.length>0? " ":"") + "navHover";
		}
		navEls[i].onMousedown=function() {
			this.className += (this.className.length>0? " ":"") + "navHover";
		}
		navEls[i].onmouseup=function() {
			this.className += (this.className.length>0? " ":"") + "navHover";
		}
		navEls[i].onmouseout=function() {
			this.className = this.className.replace(new RegExp("( ?|^)navHover\\b"), ""); 
		}
	}
}
function pagingActive() {
	var pEls = $(".myPagination").find('ul li');
	pEls.each(function(el,index) {
		$(this).on('click', function() {
			if(!($(this).hasClass('pre') || $(this).hasClass('next'))){
			$('.myPagination').find('ul li.active').removeClass('active');
			$(this).addClass('active');
				
			}
		});
	});
	/*for (var i=0; i<pEls.length; i++) {
		pEls[i].mouseclick=function() {
			this.className += (this.className.length>0? " ":"") + "active";
			for (var j=0; j<pEls.length; j++) {
				if(j!==i){
					pEls[j]=function() {
						console.log(this);
						this.removeClass("active"); 
					}
				}
			}
		}
	}*/
}
window.onload =function() { navActive();  pagingActive(); }
